﻿using System;
using System.ComponentModel.DataAnnotations;

namespace IFDB.Models.Tables
{
    public class TeamBadge
    {
        public TeamBadge()
        {
        }

        [Key]
        public Guid TeamBadgeId { get; set; }

        public Guid TeamId { get; set; }

        [StringLength(50)]
        public string BadgePath { get; set; }

        public DateTime StartDate { get; set; }
        public DateTime EndDate { get; set; }

        public static TeamBadge CreateNew(string badgePath, Guid teamId, DateTime startDate, DateTime endDate)
        {
            return new TeamBadge()
            {
                TeamBadgeId = Guid.NewGuid(),
                TeamId = teamId,
                BadgePath = badgePath,
                StartDate = startDate,
                EndDate = endDate
            };
        }

        public static TeamBadge Update(TeamBadge teamBadge, Guid teamId, string badgePath, DateTime startDate, DateTime endDate)
        {
            teamBadge.BadgePath = badgePath;
            teamBadge.TeamId = teamId;
            teamBadge.StartDate = startDate;
            teamBadge.EndDate = endDate;

            return teamBadge;
        }
    }
}
